<template>
  <div class="message">
     <header>
          <img @click="back" src="http://bpic.588ku.com/original_pic/19/04/18/9ac65d10f0e5ede674d0ab0abcad5b96.jpg" alt="">
          <h3>张先生</h3>
     </header>
     <div class="content">
       <div class="item" >
         <div class="top"  >
              <div class="topBox" >
                  <dl class="dl" >
                    <dt>
                        <img :src="newList[1].BaseDetail.Onebroker.brokerimg" alt="">
                    </dt>
                    <dd class="dd">
                        <h3>{{newList[1].BaseDetail.Onebroker.username}}</h3>
                    </dd>
                  </dl>
                  <span class="time" >{{newList[1].firstuptimestr}} </span>
              </div>
              <h3 class="address">{{newList[1].housetitle}}</h3>
          </div>
          <div class="bot">
              <div class="text">
                  <div class="area">
                    <span>意向区域:</span>
                    <span>{{newList[1].qyname}}</span>
                  </div>
                  <div class="price">
                    <span>意向价格:</span> 
                    <span class="money">{{newList[1].price}}/月</span>
                  </div>
              </div>

          </div>
       </div>
          
     </div>
  </div>
</template>

<script>
import {getList} from '../../services/index'
export default {
    data() {
      return {
        msgList:[],
        delId:'',
        newList:[],
        ok:[],
      }
      
    },
    // Page({
    onLoad: function (option) { //定义的id要一致
    
        console.log(option.id,'postid')
        this.delId=option.id
        console.log(this.delId,'del');
    } ,
// }),
onShow: function() {
    this.onLoad()
},
    async onShow(){

        //页面列表
        let result=await getList(
            'broom=&buildarea=&communityid=&decoratetype=&floortype=&heading=&keywords=&location=&nearby=&othertype=&price=&renttype=&districtids=&sqids=&lineid=&stationid=&tags=&psort=&lift=&heatingType=&buildType=&page=1&pcount=15&source=3'
        )
        let ite=0
        let arrIndex=2
        if(result.status==200){
            this.msgList=result.data.list
        }
        console.log(this.msgList,'msgList');

        for(var i=0;i<this.msgList.length;i++){
            if(i!=ite&&i!=arrIndex&&i!=this.msgList.length-1){
                // console.log(i,'fffff');
                this.newList.push(this.msgList[i])
            }
        }
        console.log(this.newList[1],'newList');

    },
    methods: {
      back(){
           wx.navigateTo({    //保留当前页面，跳转到应用内的某个页面（最多打开5个页面，之后按钮就没有响应的）
                url:"/pages/soliciting/index"
            })
      },
      
    },
}
</script>

<style lang="scss" scoped>
  .message{
    width: 100%;
    height: 100%;
    background-color: rgb(35,145,249);
    display: flex;
    flex-direction: column;
  }
  header{
        width: 100%;
        height: 80rpx;
        line-height: 60rpx;
        margin-top: 50rpx;
        margin-bottom: 10px;
        display: flex;
        padding: 0 20px;
        box-sizing: border-box;
        align-items: center;
        color:#fff ;
        h3{
            margin: 0px 100px;
        }
        img{
            width: 20px;
            height: 20px;
            padding: 0px 5px;
        }
  }
  .content{
        flex: 1;
        background-color: rgb(242,242,242);
        display: flex;
        flex-direction: column;
        .item{
                width: 100%;
                background: #fff;
                margin-bottom: 20px;
                display: flex;
                flex-direction: column;
            }
            .top{
                display: flex;
                flex-direction: column;
                border-bottom: 1px solid #ccc;
                margin-top: 20px;
            }
            .topBox{
                display: flex;
                justify-content: space-between;
                align-items: center;
            .time{
                margin-right: 20px;
            }
            } 
            .dl{
                display: flex;
                margin: 0px 10px;
                align-items: center;
                img{
                    width: 50px;
                    height: 50px;
                    border-radius: 50%;
                }
            }
            .dd{
                display: flex;
                flex: 1;
                justify-content:space-between;
                padding: 0 10px;
            }
            .address{
                margin: 15px 10px;
            }
            .bot{
                width: 100%;
                display: flex;
                justify-content: space-between;
                margin: 20px 0px;
                box-sizing: border-box;
                .text{
                    display: flex;
                    .area{
                        display: flex;
                         margin: 0px 3px;
                         box-sizing: border-box;
                    }
                    .price{
                        display: flex;
                    }
                    span{
                        margin: 0px 5px;
                    }
                    .money{
                        color: red;
                    }
                }
                .icon{
                    display: flex;
                    margin-right: 10px;
                    width: 20%;
                    font-size: 12px;
                    // background-color: #ccc;
                    justify-content: space-around;
                    align-items: center;
                    img{
                        width: 20px;
                        height: 20px;
                        padding: 0px 5px;
                    }
                }
            }
  }
</style>